<template>
  <div id="myOrder">
    <template v-if="!($route.meta.name == '处理订单')">
      <el-menu :default-active="$route.path"
               class="el-menu-demo"
               mode="horizontal">
        <el-menu-item v-for="(item,index) in tab"
                      :index="item.path"
                      @click="handleSelect(item.path)"
                      :key="index">{{item.title}}
        </el-menu-item>
      </el-menu>
      <div class="line"></div>
    </template>
    <router-view/>
  </div>
</template>

<script>
  export default {
    name: "MyOrder",
    data(){
      return{
        tab:[
          {title:'全部',path:'/server/myOrder/all'},
          {title:'待接受',path:'/server/myOrder/wait'},
          {title:'待处理',path:'/server/myOrder/handle'},
          {title:'已完成',path:'/server/myOrder/finish'},
          {title:'已拒绝',path:'/server/myOrder/reject'},
        ]
      }
    },
    methods: {
      handleSelect(path) {
        this.$router.push(path)
      }
    }
  }
</script>

<style scoped>

</style>